package com.just.login.controller;

import com.just.login.Model.User;
import com.just.login.service.UserService;

import java.util.Scanner;

public class UserController {
    UserService userService = new UserService();
    Scanner sc = new Scanner(System.in);
    public void doRegister() {
        System.out.print("请输入用户名：");
        String username = sc.next();
        System.out.println();
        System.out.println("请输入密码：");
        String password = sc.next();
        System.out.println();
        User user = new User(username, password);
        userService.doRegister(user);
    }

    public void doLogin() {
        System.out.print("请输入用户名：");
        String username = sc.next();
        System.out.println();
        System.out.println("请输入密码：");
        String password = sc.next();
        System.out.println();
        User user = new User(username, password);
        userService.doLogin(user);
    }
}
